<?php
include($include_path . "log4php/Logger.php");
class LogWriter {
	//singleton instance
	private static $instance;
	private $logger;
	public static $LOG_LEVEL_INFO = "I";
	public static $LOG_LEVEL_DEBUG = "D";
	public static $LOG_LEVEL_WARN = "W";
	public static $LOG_LEVEL_ERROR = "E";
	public static $LOG_LEVEL_FATAL = "F";
		
	//private constructor
	private function __construct($config_file){
		if (!$this->logger) {
			Logger::configure($config_file);
			$this->logger = Logger::getRootLogger();
		}
	}
	
	//returns the singleton instance
	public static function getInstance($config_file) {
		if (!self::$instance) {
			self::$instance = new self($config_file);
		}
		return self::$instance->logger; 
	}
} 
?>